package com.ideawedo.orm;
/**
* @author	李小布
* @email	397554852@qq.com
* @version	创建时间：2018年11月26日 下午12:02:51
*/

import java.sql.Connection;
import java.util.HashMap;
import java.util.Map;

import com.ideawedo.tools.DBPool;

public class MyORMManager {
	private static Map<String, String> InsertMap = new HashMap<String, String>();
	private static Map<String, String> UpdateMap = new HashMap<String, String>();
	private static Map<String, String> QueryMap = new HashMap<String, String>();
	
	private static DBPool dbPool = new DBPool();
	
	public static Connection GetConnect() {
		return dbPool.getConnection();
	}
	
	public static void AddInsertMap(String key, String value) {
		InsertMap.put(key, value);
	}
	
	public static void AddUpdateMap(String key, String value) {
		UpdateMap.put(key, value);
	}
	
	public static void AddQueryMap(String key, String value) {
		QueryMap.put(key, value);
	}
	
	public static boolean JudgeInsertMap(String key) {
		return InsertMap.containsKey(key);
	}
	
	public static boolean JudgeUpdateMap(String key) {
		return UpdateMap.containsKey(key);
	}
	
	public static boolean JudgeQueryMap(String key) {
		return QueryMap.containsKey(key);
	}
	
	public static String GetInsertSql(String key) {
		return InsertMap.get(key);
	}
	
	public static String GetUpdateSql(String key) {
		return UpdateMap.get(key);
	}
	
	public static String GetQuerySql(String key) {
		return QueryMap.get(key);
	}
}
